#pragma once

#include "../../test.h"
#include "../IniValue.hpp"

namespace header
{
namespace test
{

using namespace ini;

TEST(IniValue)
{
    IniValue v;
    EXPECT_EQ("null", v.str());

    v = false;
    EXPECT_FALSE(v.to_bool());
    EXPECT_EQ("false", v.str());

    v = true;
    EXPECT_TRUE(v.to_bool());
    EXPECT_EQ("true", v.str());

    v = 100;
    EXPECT_EQ(100, v.to_int());
    EXPECT_EQ("100", v.str());

    v = 3.14;
    EXPECT_EQ(3.14, v.to_double());
    EXPECT_EQ(std::to_string(3.14), v.str());

    v = "string";
    EXPECT_EQ("string", v.to_string());
    EXPECT_EQ("string", v.str());
}

}   // namespace test
}   // namespace header
